import config from './api.mjs';
import { syncDocs, syncAllReposDocs } from './syncYuqueDocs.mjs';
import { syncYuqueWithFrontmatter } from './dealYuque.mjs';
const {
  login,
  repo,
  cacheDir,
  contentOutputDir,
  isDownloadAll,
  addFrontmatter,
} = config;
if (addFrontmatter) {
  //是否导出带有frontmatter的文档
  syncYuqueWithFrontmatter(login, repo, cacheDir, contentOutputDir);
} else if (isDownloadAll) {
  //导出所有文档
  syncAllReposDocs(login, cacheDir, contentOutputDir);
} else {
  //导出单个知识库的原始文档
  syncDocs(login, repo, cacheDir, contentOutputDir);
}
